package com.libinshen.wxpay.payV3Wx.controller;

import com.libinshen.wxpay.common.vo.CommonResult;
import com.libinshen.wxpay.payV3Wx.entity.ProductInfo;
import com.libinshen.wxpay.payV3Wx.service.ProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lbs
 */
@CrossOrigin
@Api(tags = "商品管理")
@RestController
@RequestMapping("/api/product")
public class ProductController {

    @Resource
    private ProductService productService;

    @ApiOperation("商品列表")
    @GetMapping("/list")
    public CommonResult list() {
        List<ProductInfo> list = productService.list();
        return CommonResult.ok().data("productList", list);
    }

}
